public class work3 {
    public static boolean isPrimeBasic(int n) {
        if (n <= 1) return false;
        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) return false;
        }
        return true;
    }

    public static void printPrimesBasic() {
        int count = 0;
        for (int i = 1; i <= 20000; i++) {
            if (isPrimeBasic(i)) {
                System.out.print(i + "\t");
                if (++count % 5 == 0) System.out.println();
            }
        }
    }

    public static void main(String[] args) {
        printPrimesBasic();
    }
}